package helpers;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class CardDeck implements Serializable {

	private static final long serialVersionUID = -1297337875294276600L;
	private final List<Card> cards;

	public CardDeck() {
		this.cards = new ArrayList<Card>();
		for (Color c : Color.values()) {
			for (Value v : Value.values()) {
				cards.add(new Card(c, v));
			}
		}
	}

	public Card getRandomCard() {
		Card picked = cards.get((int) (Math.random() * cards.size()));
		cards.remove(picked);
		return picked;
	}

}
